Skip to content

Keep prune cleanup walking both managed worktree roots#226

Merged
NagyVikt merged 2 commits intomainfrom
agent/codex/split-claude-worktrees-under-omc-2026-04-21-13-46
Apr 21, 2026
Merged

Keep prune cleanup walking both managed worktree roots#226
NagyVikt merged 2 commits intomainfrom
agent/codex/split-claude-worktrees-under-omc-2026-04-21-13-46

Conversation

@NagyVikt
Copy link
Copy Markdown
Collaborator

Automated by scripts/agent-branch-finish.sh (PR flow).

NagyVikt added 2 commits April 21, 2026 14:02
Claude sessions need a separate sandbox root under .omc, but the shared branch-start, finish, prune, setup, and workspace-discovery paths still have to agree on where a branch lives. This keeps the root decision centralized, stores it on the branch, and extends the docs and install regressions around both managed worktree roots.

Constraint: Claude and Codex sessions must keep separate managed worktree roots while sharing the same finish and prune scripts
Rejected: Add Claude-only finish/prune variants | duplicates Guardex workflow authority and recovery logic
Confidence: high
Scope-risk: moderate
Reversibility: clean
Directive: Keep live scripts, template copies, and install regressions aligned whenever worktree-root routing changes
Tested: node --test --test-name-pattern='into nested git repos, skipping node_modules/worktrees/submodules|setup --parent-workspace-view creates one-level-up VS Code workspace for repo \+ agent worktrees|doctor on protected main bootstraps sandbox branch even before setup exists|setup agent-branch-start routes Claude sessions into \.omc worktrees and stores the selected root|agent-branch-finish handles Claude-root worktrees when inferring base from source branch metadata' test/install.test.js; node --check bin/multiagent-safety.js; bash -n scripts/agent-branch-start.sh scripts/agent-branch-finish.sh scripts/agent-worktree-prune.sh templates/scripts/agent-branch-start.sh templates/scripts/agent-branch-finish.sh templates/scripts/agent-worktree-prune.sh; node --test test/frontend-how-it-works.test.js test/fuzzing.test.js test/metadata.test.js; npm_config_cache=/tmp/guardex-npm-cache npm pack --dry-run
Not-tested: full npm test remains red because test/metadata.test.js already fails on main in 'active doctor command remains single-source and runs the repair-first path'
The first finish attempt rebased cleanly except for a stale assertion, and the post-conflict fallback check exposed that agent-worktree-prune still referenced a removed single-root variable. This follow-up keeps relocation logic iterating across both managed roots and aligns the fallback test with the message codex-agent emits today.

Constraint: Cleanup paths must work for both .omx and .omc managed worktrees without reintroducing separate prune implementations
Rejected: Leave the prune warning as a known issue | it breaks auto-cleanup during the exact fallback flow this branch touches
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: When changing managed worktree root selection, re-run both prune cleanup paths and the codex-agent fallback test together
Tested: bash -n scripts/agent-worktree-prune.sh templates/scripts/agent-worktree-prune.sh; node --test --test-name-pattern='into nested git repos, skipping node_modules/worktrees/submodules|setup --parent-workspace-view creates one-level-up VS Code workspace for repo \+ agent worktrees|doctor on protected main bootstraps sandbox branch even before setup exists|setup agent-branch-start routes Claude sessions into \.omc worktrees and stores the selected root|agent-branch-finish handles Claude-root worktrees when inferring base from source branch metadata' test/install.test.js; node --test --test-name-pattern='codex-agent restores local branch and falls back to safe worktree start when starter script switches in-place' test/install.test.js
Not-tested: full npm test remains red on main because test/metadata.test.js already fails in 'active doctor command remains single-source and runs the repair-first path'
@NagyVikt NagyVikt merged commit 351049c into main Apr 21, 2026
@NagyVikt NagyVikt deleted the agent/codex/split-claude-worktrees-under-omc-2026-04-21-13-46 branch April 21, 2026 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant